{* Extend our master template *}
{extends file="master.tpl"}

{* This block is defined in the master.php template *}
{block name=content}
    <div class="row">
        <div class="col-md-12">
            <form id="form" class="form-horizontal" method="post">
                <div class="panel panel-default">
                    {include file="components/panel_heading.tpl" title=$title sub_title=$sub_title}
                    <div class="panel-body">
                        {if !empty($privileges)}
                            {foreach from=$privileges item=item}
                                <div class="list-group">
                                    <div class="list-group-item">
                                        <h4 class="list-group-item-heading">{$item['name']}</h4>
                                        <div class="list-group-item-text">
                                            {foreach from=$item['permission'] item=order}
                                                <p>
                                                {foreach from=$order item=permisson key=key}
                                                    <label class="checkbox-inline">
                                                      <input type="checkbox" name="privilege[{$key}]" value="{if $permisson['checked'] == 'Y'}1{else}0{/if}" {if $permisson['checked'] == 'Y'}checked="checked"{/if}> {$permisson['name']}
                                                    </label>
                                                {/foreach}
                                                </p>
                                            {/foreach}
                                        </div>
                                    </div>
                                </div>
                            {/foreach}
                        {/if}
                    </div><!-- panel-body -->
                    {include file="components/panel_footer.tpl"}
                </div><!-- panel -->
            </form>
        </div>
    </div>
{/block}